home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsICharsetConverterManager.idl < prev    next >
Encoding:
Text File  |  2006-05-08  |  5.1 KB  |  139 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is character set conversion service
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corp.
  19.  * Portions created by the Initial Developer are Copyright (C) 2003
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *  Alec Flett <alecf@flett.org>
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40. #include "nsISupportsArray.idl"
  41. #include "nsIAtom.idl"
  42.  
  43. %{ C++
  44. #include "nsIUnicodeDecoder.h"
  45. #include "nsIUnicodeEncoder.h"
  46. #include "nsString.h"
  47.  
  48.  
  49. // XXX change to NS_CHARSETCONVERTERMANAGER_CID
  50. #define NS_ICHARSETCONVERTERMANAGER_CID \
  51.   {0x3c1c0163, 0x9bd0, 0x11d3, { 0x9d, 0x9, 0x0, 0x50, 0x4, 0x0, 0x7, 0xb2}}
  52.  
  53. // XXX change to NS_CHARSETCONVERTERMANAGER_PID
  54. #define NS_CHARSETCONVERTERMANAGER_CONTRACTID "@mozilla.org/charset-converter-manager;1"
  55. %}
  56.  
  57. interface nsIUnicodeDecoder;
  58. interface nsIUnicodeEncoder;
  59. interface nsIUTF8StringEnumerator;
  60.  
  61. /**
  62.  *
  63.  * Here Charsets are indentified by ASCII strings. Charset alias
  64.  * resolution is provided by default in most methods. "Raw"
  65.  * versions that do not need this resolution are also provided.
  66.  *
  67.  * @created         21/Feb/2000
  68.  * @author  Catalin Rotaru [CATA]
  69.  */
  70. [scriptable, uuid(f5323a76-c8f7-4c65-8d0c-1250e969c7d5)]
  71. interface nsICharsetConverterManager : nsISupports
  72. {
  73.     /**
  74.      * Get the Unicode decoder for the given charset.
  75.      * The "Raw" version skips charset alias resolution
  76.      */
  77.     nsIUnicodeDecoder getUnicodeDecoder(in string charset);
  78.     nsIUnicodeDecoder getUnicodeDecoderRaw(in string charset);
  79.  
  80.     /**
  81.      * Get the Unicode encoder for the given charset.
  82.      * The "Raw" version skips charset alias resolution
  83.      */
  84.     nsIUnicodeEncoder getUnicodeEncoder(in string charset);
  85.     nsIUnicodeEncoder getUnicodeEncoderRaw(in string charset);
  86.  
  87.     /**
  88.      * A shortcut to calling nsICharsetAlias to do alias resolution
  89.      */
  90.     ACString getCharsetAlias(in string charset);
  91.     
  92.     /**
  93.      * Get the complete list of available decoders.
  94.      */
  95.     nsIUTF8StringEnumerator getDecoderList();
  96.  
  97.     /**
  98.      * Get the complete list of available encoders.
  99.      */
  100.     nsIUTF8StringEnumerator getEncoderList();
  101.  
  102.     /**
  103.      * Get the complete list of available charset detectors.
  104.      */
  105.     nsIUTF8StringEnumerator GetCharsetDetectorList();
  106.  
  107.     /**
  108.      * Get the human-readable name for the given charset.
  109.      */
  110.     AString getCharsetTitle(in string charset);
  111.  
  112.     /**
  113.      * Get some data about the given charset. This includes whether the 
  114.      * character encoding may be used for certain purposes, if it is 
  115.      * multi-byte, and the language code for it. See charsetData.properties
  116.      * for the source of this data. Some known property names:
  117.      *    notForBrowser  - not to be used in the bowser.
  118.      *    notForOutgoing - not to be used for exporting files.
  119.      *    LangGroup      - language code for charset, e.g. 'he' and 'zh-CN'.
  120.      *    isMultibyte    - is this a multi-byte charset?
  121.      * 
  122.      * @param charset name of the character encoding, e.g. 'iso-8859-15'.
  123.      * @param prop property desired for the character encoding.
  124.      * @return the value of the property, for the character encoding.
  125.      */
  126.     AString getCharsetData(in string charset, 
  127.                            in wstring prop);
  128.  
  129.     /**
  130.      * Get the language group for the given charset. This is similar to 
  131.      * calling <tt>getCharsetData</tt> with the <tt>prop</tt> "LangGroup".
  132.      * 
  133.      * @param charset name of the character encoding, e.g. 'iso-8859-15'.
  134.      * @return the language code for the character encoding.
  135.      */
  136.     nsIAtom getCharsetLangGroup(in string charset);
  137.     nsIAtom getCharsetLangGroupRaw(in string charset);
  138. };
  139.